
<?php
session_start();
require_once '../dao/DoctorDao.php';
require_once '../dto/DoctorDto.php';
require_once '../../phpGrid/conf.php';
?>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="../css/style.css" media="screen" />
        <title>Doctor List</title>
        <script type="text/javascript">
            function ShowSelectedRows() {          
                var x;
                var r=confirm("Do you want to delete?");
                if (r==true)
                {
                    var rows = getSelRows();
                    var listEmail = document.getElementById("doctorListEmail");
                    listEmail.setAttribute("value", rows);
                }
            }
        </script>
    </head>
    <body class="body">
        <header class="header">
            <div class="inner_doctor_list">
                <div class="header_content_doctor_list">GROW</div>
                <div class="admin_name_doctor_list"><?php echo $_SESSION["AdminEmail"]; ?></div>
            </div>
        </header>
        <form class="main_form_doctor_list" action="../bus/DeleteDoctor.php"  method="post">
            <input id ="doctorListEmail" name="doctorListEmail" type="hidden" value ="aaaaaaaa" />
            <div class="title_doctor_list">Doctor List</div>
            <input type="submit" id ="submit" onclick="ShowSelectedRows()" class="button_delete" value="Delete"/>
            <div class="main_content_doctor_list">
                <?php
                $arrDoctors = DoctorDao::LoadAllDoctor();

                $dg = new C_DataGrid("SELECT * FROM doctor", "email", "doctor");

                // change column titles
                $dg->set_col_title("email", "Email");
                $dg->set_col_align('email', 'center');
                $dg->set_col_width("email", 3);

                //
                $dg->set_col_title("first_name", "Name");
                $dg->set_col_width("first_name", 2);
                $dg->set_col_align('first_name', 'center');



                // hide a columnb
                $dg->set_col_hidden("last_name");
                $dg->set_col_hidden("password");
                // change default caption
                $dg->set_caption("Doctor List");

                $dg->enable_rownumbers(true);

                $dg->set_pagesize(10);
                $dg->set_multiselect(true);
                $dg->display();
                ?>
            </div>
        </form>
    </body>
</html>
